<html>
<head>
    <script src="../tma.js"></script>
    <script>
        tma.onload = function () {
            // All libraries are loaded asynchronously.
            var screen = new TmaScreen(320, 320);
            screen.attachTo(TmaScreen.BODY);
            var cx = screen.width / 2;
            var cy = screen.height / 2;
            var r = (cx < cy) ? cx : cy;
            var w = Math.PI / 2;
            var h = 0;

            function main () {
                screen.lock();
                var dx = cx + ~~(r * Math.cos(w));
                var dy = cy + ~~(r * Math.sin(w));
                screen.drawLine(cx, cy, dx, dy, h, 1.0, 1.0, 0xff, true);
                w += 0.01;
                h = (h + 1) % 360;
                screen.unlock();
            }

            setInterval(main, 10);
        };
    </script>
</head>
</html>
